import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
// import Home from '@/layout'
import Login from '@/views/Login.vue'
// 公有权限列表
export const publicRouter = [
	{
		path: '/',
		redirect: '/home/userInfo',
	},
	{
		path: '/login',
		name: 'login',
		component: Login,
	},
	{
		path: '/home',
		name: 'home',
		component: Home,

		meta: {
			title: '系统首页',
			icon: 'fa fa-group',
		},
		children: [
			{
				path: '/home/userInfo',
				name: '个人中心',

				component: () => import('../views/user/UserInfo.vue'),
				meta: {
					title: '个人中心',
					icon: 'fa fa-group',
				},
			},
		],
	},
]

const router = createRouter({
	history: createWebHistory(),
	routes: publicRouter,
})

export default router
